package com.tkmybatis.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Project_name: tk_mybatis_demo
 * Company: 新致软件
 * Author: ZHU YU WEI
 * Date: Created in 17:50 2021/4/5.
 * Description:
 * Modified By:
 */
@Component
@Slf4j
@RabbitListener(queuesToDeclare = @Queue(value = "hello",durable = "true",autoDelete = "false"))  //消费者定时监控消息队列hello,不自动删除
public class ConsumerReceiveMessages {


    @RabbitHandler
    public void consumerReceiveMessages(String message){
        log.info("消费者获取到消息内容是=====  "+message);
    }





}
